package com.oms.constant;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * @Author zhanghailong
 * @Description TODO
 * @Date 19:08 2020/3/28
 */
public enum SqlOrderEnum implements IEnum<Boolean> {

    /**
     * ASC 正序
     */
    ASC(true),

    /**
     * DESC 倒序
     */
    DESC(false);

    private boolean value;

    private SqlOrderEnum(Boolean value) {
        this.value = value;
    }

    @Override
    public Boolean getValue() {
        return value;
    }

    @Override
    public String toString() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        for (StackTraceElement e : stackTrace) {
            if(e.getClassName().startsWith("springfox")){
                return "ASC:正序，DESC:倒序";
            }
        }
        return super.toString();
    }
}
